﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once
#include "IPositionAssociatedPlane.h"

namespace gcmp
{
    class IDocument;
    class Coordinate3d;
    class Vector3d;
    class Matrix4d;
    /// \brief 关联坐标系定位接口类
    ///
    /// 关联坐标系定位类，仅允许外部访问数据，不允许外部从此类中继承
    class GCMP_MODEL_INTERFACE_EXPORT IPositionAssociatedCoordinate : public IPositionAssociatedPlane
    {
        DEFINE_CAST_DERIVED(gcmp::IPositionAssociatedCoordinate, gcmp::IPositionAssociatedPlane)
    public:
      /// \brief 创建关联坐标系定位
      /// \param pElement 元素指针
      /// \param coordinate 坐标系
      /// \param offset 基于坐标系的偏移量
      /// \return 关联坐标系定位指针
      static OwnerPtr<IPositionAssociatedCoordinate> Create(IElement *pElement, const Coordinate3d &coordinate, double offset = 0);
    public:
        /// \brief 得到坐标系
        /// \return 坐标系
        virtual const Coordinate3d& GetCoordinate3d() const = 0;

        /// \brief 设置坐标系
        /// \param coordinate 坐标系
        /// \return 返回true表示成功设置，否则表示失败
        virtual bool SetCoordinate3d(const Coordinate3d& coordinate) = 0;

        /// \brief 得到基于坐标系的偏移量
        /// \return 偏移量
        virtual double GetOffset() const = 0;

        /// \brief 设置基于坐标系的偏移量
        /// \param value 偏移量
        /// \return 返回true表示成功设置，否则表示失败
        virtual bool SetOffset(double value) = 0;

        /// \brief 执行移动操作
        /// \param moveDirection 移动向量
        /// \return 返回true表示成功执行移动操作，否则表示失败
        virtual bool Translate(const Vector3d& moveDirection) = 0;

        /// \brief 执行矩阵转换操作
        /// \param matrix 转换矩阵
        /// \return 返回true表示成功执行矩阵转换操作，否则表示失败
        virtual bool Transform(const Matrix4d& matrix) = 0;
    };
}


